package com.lagou.demo.controller;

import com.lagou.demo.service.DemoService;
import com.lagou.mvc.annotations.Autowired;
import com.lagou.mvc.annotations.Controller;
import com.lagou.mvc.annotations.RequestMapping;
import com.lagou.mvc.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/demo")
@Security({"lily", "lucy"})
public class DemoController {

    @Autowired
    private DemoService demoService;

    @Security({"tom", "jack"})
    @RequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        System.out.println("DemoController: query");
        return demoService.get(name);
    }
}
